home *** CD-ROM | disk | FTP | other *** search
/ PC-X 1997 October / pcx14_9710.iso / swag / delphi.swg / 0060_Getting rid of title bar.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-11-24  |  1.1 KB  |  40 lines

  1.  
  2. Procedure TYourFormName.HideTitlebar;
  3. Var
  4.   Save : LongInt;
  5. Begin
  6.   If BorderStyle=bsNone then Exit;
  7.   Save:=GetWindowLong(Handle,gwl_Style);
  8.   If (Save and ws_Caption)=ws_Caption then Begin
  9.     Case BorderStyle of
  10.       bsSingle,
  11.       bsSizeable : SetWindowLong(Handle,gwl_Style,Save and
  12.         (Not(ws_Caption)) or ws_border);
  13.       bsDialog : SetWindowLong(Handle,gwl_Style,Save and
  14.         (Not(ws_Caption)) or ds_modalframe or ws_dlgframe);
  15.     End;
  16.     Height:=Height-getSystemMetrics(sm_cyCaption);
  17.     Refresh;
  18.   End;
  19. end;
  20.  
  21. Procedure TYourFormName.ShowTitlebar;
  22. Var
  23.   Save : LongInt;
  24. begin
  25.   If BorderStyle=bsNone then Exit;
  26.   Save:=GetWindowLong(Handle,gwl_Style);
  27.   If (Save and ws_Caption)<>ws_Caption then Begin
  28.     Case BorderStyle of
  29.       bsSingle,
  30.       bsSizeable : SetWindowLong(Handle,gwl_Style,Save or ws_Caption or
  31.         ws_border);
  32.       bsDialog : SetWindowLong(Handle,gwl_Style,Save or ws_Caption or
  33.         ds_modalframe or ws_dlgframe);
  34.     End;
  35.     Height:=Height+getSystemMetrics(sm_cyCaption);
  36.     Refresh;
  37.   End;
  38. end;
  39.  
  40.